#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //ui->graphicsView->setBackgroundBrush(QImage(":/png/rsc/img/icons/thumb_up.png"));
    //ui->graphicsView->setBackgroundBrush(QImage(":/jpg/rsc/img/maps/germany-map.jpg"));
    //ui->graphicsView->setCacheMode(QGraphicsView::CacheBackground);

    //ui->graphicsView->setStyleSheet(QString(" QGraphicsView { background: transparent; ")+
      //                              "border-image: url(:/jpg/rsc/img/maps/germany-map.jpg); }"); //+
                                    //"background-origin: content; "+
                                    //"background-repeat: none; }");

    scene = new QGraphicsScene();
    QGraphicsPixmapItem *item = new QGraphicsPixmapItem();
    //item->setPixmap(QPixmap::fromImage(QImage(":/jpg/rsc/img/maps/germany-map.jpg")));
    item->setPixmap(QPixmap::fromImage(QImage(":/svg/rsc/img/maps/germany-map.svg")));
    //item->setScale(1.65);
    //item->setRect(50,50,250,250);
    //item->setBrush(Qt::red);
    item->setFlags(QGraphicsItem::ItemIsSelectable);
    item->setData(0, "Germany Map");

    scene->addItem(item);
    ui->graphicsView->setScene(scene);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_actionExit_triggered()
{
    close();
}
